<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>URL Redirector</title>
  <style>
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background-color: #f7f7f7;
      color: #333;
      margin: 0;
      width: 380px;
    }
    .container {
      padding: 12px;
    }
    .section {
      background-color: #fff;
      border-radius: 8px;
      margin-bottom: 12px;
      border: 1px solid #e0e0e0;
    }
    .section-header {
      padding: 8px 12px;
      border-bottom: 1px solid #e0e0e0;
    }
    .section-title {
      font-size: 11px;
      font-weight: 600;
      color: #666;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .section-content {
      padding: 8px;
    }
    .toggle-switch {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .toggle-switch label {
      font-size: 14px;
    }
    .rule {
      display: grid;
      grid-template-columns: auto 1fr auto 1fr auto;
      gap: 8px;
      align-items: center;
      margin-bottom: 10px;
    }
    .rule:last-child {
      margin-bottom: 0;
    }
    input[type="text"] {
      width: 100%;
      padding: 8px;
      border: 1px solid #ccc;
      border-radius: 4px;
      font-size: 13px;
      box-sizing: border-box;
    }
    input[type="checkbox"] {
      transform: scale(1.2);
    }
    .arrow {
      font-size: 16px;
      color: #888;
    }
    .btn {
      border: none;
      border-radius: 6px;
      padding: 8px 12px;
      font-size: 13px;
      cursor: pointer;
      font-weight: 500;
    }
    .btn-primary {
      background-color: #007aff;
      color: white;
      width: 100%;
    }
    .btn-delete {
      background-color: #f1f1f1;
      color: #555;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="section">
      <div class="section-content">
        <div class="toggle-switch">
          <label for="enabled">启用 Redirector</label>
          <input type="checkbox" id="enabled">
        </div>
      </div>
    </div>

    <div class="section">
      <div class="section-header">
        <h2 class="section-title">规则</h2>
      </div>
      <div class="section-content" id="rules-container">
        <!-- Rules will be injected here by popup.js -->
      </div>
    </div>

    <button id="add-rule" class="btn btn-primary">添加新规则</button>
  </div>
  <script src="popup.js"></script>
</body>
</html>